home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
alpha
/
dipc
/
dipc-0.000
/
dipc-0
/
dipc-0.15
/
dipcd
/
dipcd.h
< prev
next >
Wrap
C/C++ Source or Header
|
1996-07-16
|
2KB
|
112 lines
/*
* dipcd.h
*
* part of dipcd source code
*
* Copyright (C) Kamran Karimi
*/
#include <sys/ipc.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <sys/times.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <signal.h>
#include <sys/msg.h>
#include <sys/shm.h>
#include <sys/sem.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include <pwd.h>
#include <linux/dipc.h>
#include "dipc_path.h"
#define DIPC_E_TIMEOUT EIO
#define DIPC_E_FORK EIO
#define DIPC_E_TYPE EINVAL
typedef int BOOLEAN;
typedef int FD;
#define BAD_FD -1
char mstr[];
#define INFO __FILE__, __LINE__
#define CONFIG_FILE "/etc/dipc.conf"
#define DIPC_TCP_PORT 6543 /* any better addresses ? */
#define DIPC_REFEREE_PORT 6520
/* maximum time a machine can have a shm, in seconds */
#define SHM_HOLD_TIMEOUT 0.5
/* maximum time an employer or key manager will
wait for a reply, in integer seconds */
#define EMPLOYER_REFEREE_TIMEOUT 40
#define EMPLOYER_SHM_TIMEOUT 50
#define EMPLOYER_WORKER_TIMEOUT 300
#define SHM_AK_TIMEOUT 30
#define REFEREE_TIMEOUT 15
#define IPC_SET 1
#define IPC_STAT 2
#define SEMOP 1
#define SEMCTL 3
#define MSGSND 11
#define MSGRCV 12
#define MSGCTL 14
#define SHMCTL 24
#define BUFF_SIZE 4096
#define MAXDATA 4100 /* 4096 + 4, for msg */
#define REQ_SHMMAN 101
#define RES_SHMMAN 1001
#define REQ_REFEREE 102
#define RES_REFEREE 1002
#define REQ_DOWORK 118
#define RES_DOWORK 1018
#define FALSE 0
#define TRUE 1
#define FAIL 0
#define SUCCESS 1
struct message {
int arch;
struct sockaddr_in address;
struct sockaddr_in address2;
int pid;
int request;
int reserved;
struct dipc_info info;
};
struct usr_info
{
char name[40];
};
#define SAME_MACHINE(a,b) ((a)->sin_addr.s_addr == (b).sin_addr.s_addr)
#define SAME_ADDRESS(a,b) (((a)->sin_addr.s_addr == (b).sin_addr.s_addr) &&\
((a)->sin_port == (b).sin_port))